package at.fhooe.stefanirndorfer.collision;

import at.fhooe.stefanirndorfer.entity.Entity;

public class CollisionDetector {

	public static boolean hasCollisionPointRect(Entity e, int x, int y){
		
		int upperLeftX = (int) e.getPosX();
		int lowerRightX = upperLeftX + (int)e.getWidth();
		int upperLeftY = (int) e.getPosY();
		int lowerRightY = upperLeftY - (int)e.getHeight();
		
		return ((x >= upperLeftX && x <= lowerRightX) && (y <= upperLeftY && y >= lowerRightY));
		
	}
}
